<%--
  Created by IntelliJ IDEA.
  User: dengry
  Date: 15/3/24
  Time: 10:52
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <base href="<%=basePath%>">
    <title></title>
    <link rel="stylesheet" type="text/css" href="resources/css/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="resources/css/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="resources/css/zTreeStyle/zTreeStyle.css">
    <script type="text/javascript" src="resources/js/jquery-1.11.1.js"></script>
    <script type="text/javascript" src="resources/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="resources/js/jquery.ztree.core-3.5.js"></script>
    <script type="text/javascript">

        var setting = {
            data: {
                simpleData: {
                    enable: true
                }
            }
        };

        var zNodes = [
            {id: 1, pId: 0, name: "父节点1 - 展开", open: true},
            {id: 11, pId: 1, name: "父节点11 - 折叠"},
            {id: 111, pId: 11, name: "叶子节点111"},
            {id: 112, pId: 11, name: "叶子节点112"},
            {id: 113, pId: 11, name: "叶子节点113"},
            {id: 114, pId: 11, name: "叶子节点114"},
            {id: 12, pId: 1, name: "父节点12 - 展开", open: true},
            {id: 121, pId: 12, name: "叶子节点121"},
            {id: 122, pId: 12, name: "叶子节点122"},
            {id: 123, pId: 12, name: "叶子节点123"},
            {id: 124, pId: 12, name: "叶子节点124"},
            {id: 2, pId: 0, name: "父节点2 ", open: true},
            {id: 21, pId: 2, name: "父节点21 - 展开", open: true},
            {id: 211, pId: 21, name: "叶子节点211"},
            {id: 212, pId: 21, name: "叶子节点212"},
            {id: 213, pId: 21, name: "叶子节点213"},
            {id: 214, pId: 21, name: "叶子节点214"},
            {id: 22, pId: 2, name: "父节点22 - 折叠"},
            {id: 221, pId: 22, name: "叶子节点221"},
            {id: 222, pId: 22, name: "叶子节点222"},
            {id: 23, pId: 2, name: "父节点23 - 折叠"},
            {id: 231, pId: 23, name: "叶子节点231"},
            {id: 232, pId: 23, name: "叶子节点232"}


        ];

        var zNodes2 = [
            {id: 1, pId: 0, name: "父节点1 - 展开", open: true},
            {id: 11, pId: 1, name: "父节点11 - 折叠"},
            {id: 111, pId: 11, name: "叶子节点111"},
            {id: 112, pId: 11, name: "叶子节点112"},
            {id: 113, pId: 11, name: "叶子节点113"},
            {id: 114, pId: 11, name: "叶子节点114"},
            {id: 12, pId: 1, name: "父节点12 - 展开", open: true},
            {id: 121, pId: 12, name: "叶子节点121"},
            {id: 122, pId: 12, name: "叶子节点122"},
            {id: 123, pId: 12, name: "叶子节点123"},
            {id: 124, pId: 12, name: "叶子节点124"},
            {id: 2, pId: 0, name: "父节点2 ", open: true},
            {id: 21, pId: 2, name: "父节点21 - 展开", open: true},
            {id: 211, pId: 21, name: "叶子节点211"},
            {id: 212, pId: 21, name: "叶子节点212"},
            {id: 213, pId: 21, name: "叶子节点213"},
            {id: 214, pId: 21, name: "叶子节点214"},
            {id: 22, pId: 2, name: "父节点22 - 折叠"},
            {id: 221, pId: 22, name: "叶子节点221"},
            {id: 222, pId: 22, name: "叶子节点222"},
            {id: 23, pId: 2, name: "父节点23 - 折叠"},
            {id: 231, pId: 23, name: "叶子节点231"},
            {id: 232, pId: 23, name: "叶子节点232"}


        ];


        $(document).ready(function () {
            $.fn.zTree.init($("#treeDemo"), setting, zNodes);
        });

        function toMenu1() {
            alert("f");
            $.fn.zTree.init($("#treeDemo"), setting, zNodes2);
        }
    </script>


</head>
<body>
<div class="easyui-layout" style="width:100%;height:620px;">
    <div data-options="region:'north'" style="height:80px"><a href="javascript:void(0)" onclick="toMenu1();">menu1</a>
    </div>
    <div data-options="region:'west',split:true" title="West" style="width:220px;">
        <div class="zTreeDemoBackground left">
            <ul id="treeDemo" class="ztree"></ul>
        </div>
    </div>
    <div data-options="region:'center',title:'Main Title',iconCls:'icon-ok'">
        <table class="easyui-datagrid"
               data-options="url:'resources/data/datagrid_data1.json',method:'get',border:false,singleSelect:true,fit:true,fitColumns:true">
            <thead>
            <tr>
                <th data-options="field:'itemid'" width="80">Item ID</th>
                <th data-options="field:'productid'" width="100">Product ID</th>
                <th data-options="field:'listprice',align:'right'" width="80">List Price</th>
                <th data-options="field:'unitcost',align:'right'" width="80">Unit Cost</th>
                <th data-options="field:'attr1'" width="150">Attribute</th>
                <th data-options="field:'status',align:'center'" width="60">Status</th>
            </tr>
            </thead>
        </table>
    </div>
</div>
</body>
</html>
